import requests
import urllib
def callback(a1,a2,a3):

    """
        @a1:目前为此传递的数据块数量
        @a2:每个数据块的大小，单位是byte,字节
        @a3:远程文件的大小
    """
    download_pg = 100.0*a1*a2/a3
    if download_pg > 100:
        download_pg = 100
    
    print("%.2f%%" %download_pg,)

url = "http://171.213.46.142:9000/mnt/3disk/HD-ipx-229.mp4"
urllib.request.urlretrieve(url,r"D:\\music\\asd.mp4",callback)

